<%@ Import Namespace="System.IO" %>
<script  runat="server">
Sub Page_Load(ByVal sender As Object, _
	ByVal e As EventArgs)
	' Specify the directories you want to manipulate.
        Dim di As DirectoryInfo = New DirectoryInfo("c:\MyDir")
        Try
            ' Determine whether the directory exists.
            If di.Exists Then
                ' Indicate that it already exists.
                Response.Write("That path exists already.")
                Return
            End If

            ' Try to create the directory.
            di.Create()
            Response.Write("The directory was created successfully.")

            ' Delete the directory.
            di.Delete()
            Response.Write("The directory was deleted successfully")

        Catch err As Exception
            Response.Write("The process failed: " + _
	err.ToString())
        End Try    
End Sub
</script>


